//
//  WHNavBackButton.m
//  DiaoJi
//
//  Created by she1323 on 2017/3/7.
//  Copyright © 2017年 she1323. All rights reserved.
//

#import "WHNavBackButton.h"

@implementation WHNavBackButton

- (void)setTitleColor:(UIColor *)titleColor
{
    _titleColor = titleColor;
    [self setTitleColor:titleColor forState:UIControlStateNormal];
}

+ (instancetype)navBackButton
{
    WHNavBackButton *button = [[WHNavBackButton alloc] init];
    //[button setImage:[UIImage imageNamed:@"navigationButtonReturn"] forState:UIControlStateNormal];
    //
    [button setImage:[UIImage imageNamed:@"fanhuijianwhite"] forState:UIControlStateNormal];
    //[button setImage:[UIImage imageNamed:@"navigationButtonReturnClick"] forState:UIControlStateHighlighted];
    button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    //[button setTitle:@"返回" forState:UIControlStateNormal];
    [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    //[button setTitleColor:[UIColor redColor] forState:UIControlStateHighlighted];
    
    button.bounds = CGRectMake(0, 0, 70, 30);
    button.contentEdgeInsets = UIEdgeInsetsMake(0, -5, 0, 0);
    button.titleLabel.font = [UIFont systemFontOfSize:15];
    return button;
}

- (void)setType:(NSInteger)type
{
    _type = type;
    if (type == 1) {
        [self setImage:[UIImage imageNamed:@"fanhuijianwhite"] forState:UIControlStateNormal];
    } else {
        [self setImage:[UIImage imageNamed:@"fanhuijianblack"] forState:UIControlStateNormal];
    }
}

@end
